package com.jiedeng.service;

import com.jiedeng.dao.IRankRepository;
import com.jiedeng.model.Rank;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by qinyuanlong on 17/3/26.
 */
@Service
public class D2Service {

    @Autowired
    private IRankRepository rankRepository;

    public List<Rank> findAll(){
        return rankRepository.findAll();
    }

    public Rank findOne(int id){
        return rankRepository.getOne(id);
    }

    public Rank saveOrUpdate(Rank rank){
        return rankRepository.save(rank);
    }

    public void delete(int id){
        rankRepository.deleteById(id);
    }
}
